/**
 * 优惠券管理
 */

import http from '@/utils/httpRequest'
export default {
    // 分页查询优惠券
    couponPage(param) {
        return http.get(http.adornUrl('/admin/coupon/page'),{params:param})
    },
    // 优惠券 新增
    couponAdd(data) {
        return http.post(http.adornUrl('/admin/coupon/add'), data)
    },
    // 优惠券 详情
    couponInfo(id) {
        return http.get(http.adornUrl(`/admin/coupon/info/${id}`))
    },
    // 优惠券 修改
    couponUpdate(data) {
        return http.put(http.adornUrl(`/admin/coupon/update`), data)
    },
    // 发布优惠券
    couponReleased(id) {
        return http.post(http.adornUrl(`/admin/coupon/released/${id}`))
    },
    // 取消发布优惠券
    couponCancelReleased(id) {
        return http.post(http.adornUrl(`/admin/coupon/cancelReleased/${id}`))
    },
    // 停止优惠券活动
    couponStop(id) {
        return http.post(http.adornUrl(`/admin/coupon/stop/${id}`))
    },
    // 恢复优惠券活动
    couponCancelStop(id) {
        return http.post(http.adornUrl(`/admin/coupon/cancelStop/${id}`))
    },
    // 批量删除优惠券
    couponDelete(ids) {
        return http.delete(http.adornUrl('admin/coupon/delete'),{data:ids})
    },
    // 分页查询优惠券的使用情况
    couponreceiverecordPage(param) {
        return http.get(http.adornUrl('/admin/couponreceiverecord/page'),{params:param})
    },
}